package com.block.datapush.service.apipush.utils;

import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;

public class YangXinHuaApibUtil {


    //收入
    public static String getShouru(String shouru) {
        if (StrUtil.equals(shouru, BaseTypeInfoEnum.Shouru.sr001.getValue())) {
            return "2";
        } else if (StrUtil.equals(shouru, BaseTypeInfoEnum.Shouru.sr002.getValue())) {
            return "3";
        } else if (StrUtil.equals(shouru, BaseTypeInfoEnum.Shouru.sr003.getValue())) {
            return "4";
        } else if (StrUtil.equals(shouru, BaseTypeInfoEnum.Shouru.sr004.getValue())) {
            return "5";
        }
        return "1";
    }

    //贷款金额
    public static Integer getLoanAmount(String loanAmount) {
        if (StrUtil.equals(loanAmount, BaseTypeInfoEnum.LoanAmount.la001.getValue())) {
            return 3;
        } else if (StrUtil.equals(loanAmount, BaseTypeInfoEnum.LoanAmount.la002.getValue())) {
            return 5;
        } else if (StrUtil.equals(loanAmount, BaseTypeInfoEnum.LoanAmount.la003.getValue())) {
            return 10;
        } else if (StrUtil.equals(loanAmount, BaseTypeInfoEnum.LoanAmount.la004.getValue())) {
            return 20;
        }
        return 25;
    }

    //贷款时间
    public static String getLoanTerm(String loanTime) {
        if (StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt002.getValue())) {
            return "1";
        } else if (StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt003.getValue())) {
            return "3";
        } else if (StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt004.getValue())) {
            return "4";
        }
        return "3";
    }

    //职业身份
    public static String getJob(String jbo) {
        if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz004.getValue())) {
            return "2";
        } else if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz002.getValue())) {
            return "4";
        } else if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz005.getValue())) {
            return "6";
        }
        return "6";
    }

    //用途
    public static String getYongTu(String yongTu){
        if(StrUtil.equals(yongTu,BaseTypeInfoEnum.Yongtu.yt001.getValue())){
            return "5";
        } else if (StrUtil.equals(yongTu,BaseTypeInfoEnum.Yongtu.yt002.getValue())) {
            return "2";
        }else if (StrUtil.equals(yongTu,BaseTypeInfoEnum.Yongtu.yt003.getValue())) {
            return "1";
        }else if (StrUtil.equals(yongTu,BaseTypeInfoEnum.Yongtu.yt004.getValue())) {
            return "3";
        }else if (StrUtil.equals(yongTu,BaseTypeInfoEnum.Yongtu.yt005.getValue())) {
            return "4";
        } else if (StrUtil.equals(yongTu,BaseTypeInfoEnum.Yongtu.yt007.getValue())) {
            return "10";
        }
        return "5";
    }

    //公积金
    public static String getGjj( String gjj) {
        if (StrUtil.equals(gjj, BaseTypeInfoEnum.Gjj.gjj001.getValue())) {
            return "0";
        } else if (StrUtil.equals(gjj, BaseTypeInfoEnum.Gjj.gjj002.getValue())) {
            return "1";
        }else if (StrUtil.equals(gjj, BaseTypeInfoEnum.Gjj.gjj003.getValue())) {
            return "2";
        }
        return "0";
    }

    //社保
    public static String getShebao( String shebao) {
        if (StrUtil.equals(shebao, BaseTypeInfoEnum.Shebao.sb001.getValue())) {
            return "0";
        } else if (StrUtil.equals(shebao, BaseTypeInfoEnum.Shebao.sb002.getValue())) {
            return "1";
        }else if (StrUtil.equals(shebao, BaseTypeInfoEnum.Shebao.sb003.getValue())) {
            return "2";
        }
        return "0";
    }

    //房产
    public static String getHouse(String house) {
        if (StrUtil.equals(house, BaseTypeInfoEnum.House.hu001.getValue())) {
            return "0";
        }
        return "1";
    }

    //车产
    public static String getCar(String car) {
        if (StrUtil.equals(car, BaseTypeInfoEnum.Car.car001.getValue())) {
            return "0";
        } else if (StrUtil.equals(car, BaseTypeInfoEnum.Car.car002.getValue())) {
            return "1";
        }else if (StrUtil.equals(car, BaseTypeInfoEnum.Car.car003.getValue())) {
            return "2";
        }
        return "0";
    }


    //芝麻
    public static String getZhima(String zhima) {
         if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm002.getValue())) {
            return "2";
        } else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm003.getValue())) {
            return "3";
        } else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm004.getValue())) {
            return "4";
        }else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm005.getValue())) {
            return "5";
         }
        return "2";
    }

    //保险
    public static String getBaoxian(String baoxian) {
        if (StrUtil.equals(baoxian, BaseTypeInfoEnum.Baoxian.bx002.getValue())) {
            return "1";
        }
        return "0";
    }

    //白条
    public static Integer getBaiTiao(String baiTiao){
        if(StrUtil.equals(baiTiao,BaseTypeInfoEnum.Baitiao.bt001.getValue())){
            return 0;
        }else if(StrUtil.equals(baiTiao,BaseTypeInfoEnum.Baitiao.bt002.getValue())){
            return 3;
        }
        return 0;
    }

    //学历
    public static String getXueli(String xueli) {
        if (StrUtil.equals(xueli, BaseTypeInfoEnum.XueLi.xl002.getValue())) {
            return "1";
        } else if (StrUtil.equals(xueli, BaseTypeInfoEnum.XueLi.xl003.getValue())) {
            return "2";
        } else if (StrUtil.equals(xueli, BaseTypeInfoEnum.XueLi.xl004.getValue())) {
            return "3";
        } else if (StrUtil.equals(xueli, BaseTypeInfoEnum.XueLi.xl005.getValue())) {
            return "4";
        }
        return "1";
    }

    //花呗
    public static Integer getHuaBei(String huaBei){
        if (StrUtil.equals(huaBei, BaseTypeInfoEnum.Huabei.hb001.getValue())) {
            return 0;
        }else if (StrUtil.equals(huaBei, BaseTypeInfoEnum.Huabei.hb002.getValue())) {
            return 3;
        }
        return 0;
    }

    //逾期
    public static String getYuqi(String yuqi) {
        if (StrUtil.equals(yuqi, BaseTypeInfoEnum.Yuqi.yq001.getValue())) {
            return "1";
        }else if (StrUtil.equals(yuqi, BaseTypeInfoEnum.Yuqi.yq002.getValue())) {
            return "2";
        }
        return "1";
    }

}
